<?php
class PNHouseNo extends PNObject {
  function PNHouseNo($init=null, $where='')
  {
    $this->PNObject();

    $this->_objType       = 'votethailandpoll_house_no';
    $this->_objField      = 'id';
    $this->_objPath       = 'form';

    $this->_init($init, $where);
  }
/*
  function insertPreProcess(){
    $vil_id = $this->_objData['vil_id'];
    if($vil_id){
      $where = 'vil_id = '.$vil_id;
      $data = DBUtil::selectObject( 'votethailandpoll_village', $where, array('moo'));
      $this->_objData['vil_moo'] = $data[moo];
    }
  }

  function updatePreProcess(){
    $vil_id = $this->_objData['vil_id'];
    if($vil_id){
      $where = 'vil_id = '.$vil_id;
      $data = DBUtil::selectObject( 'votethailandpoll_village', $where, array('moo'));
      $this->_objData['vil_moo'] = $data[moo];
    }
  }
*/
  function insertPostProcess(){
    $id = $this->_objData['id'];
    $par_id = $this->_objData['par_id'];
    $pro_id = $this->_objData['pro_id'];
    $dis_id = $this->_objData['dis_id'];
    $tam_id = $this->_objData['tam_id'];
    $vil_id = $this->_objData['vil_id'];
    $comment = $this->_objData['comment'];
   //var_dump($this->_objData); exit;
    $object = array(
                    'par_id'      => $par_id,
                    'pro_id'      => $pro_id,
                    'dis_id'      => $dis_id,
                    'tam_id'      => $tam_id,
                    'vil_id'      => $vil_id,
                    'house_no_id' => $id,
                    'comment'  => $comment,
                    'status'  => 1
                   );
 
    DBUtil::insertObject($object,'votethailandpoll_villagepoll');
  }
}